﻿Imports System.Transactions
Imports Sistema_InformacionNaviera.BE
Imports Sistema_InformacionNaviera.DALC

Public Class DesgloseBC

    'Public Function ListaDesgloses(ByVal objDesgloseBE As DesgloseBE) As DataTable
    '    Dim objDesglose As DataTable = Nothing
    '    Dim objDesgloseDALC As DesgloseDALC = Nothing

    '    objDesgloseDALC = New DesgloseDALC
    '    objDesglose = New DataTable
    '    objDesglose = objDesgloseDALC.ListaDesglose(objDesgloseBE)

    '    Return objDesglose
    'End Function


    Public Function Lista_BL_Desgloses(ByVal objDesgloseBE As DesgloseBE) As DataTable
        Dim objDesglose As DataTable = Nothing
        Dim objDesgloseDALC As DesgloseDALC = Nothing

        objDesgloseDALC = New DesgloseDALC
        objDesglose = New DataTable
        objDesglose = objDesgloseDALC.ListaDesglose_BLImpo(objDesgloseBE)

        Return objDesglose
    End Function


    Public Function ObtenerDesgloseDetalle(ByVal objDesgloseBE As DesgloseBE, ByRef dt As DataTable, ByRef bExito As Boolean, ByRef sMensaje As String) As DataTable
        Dim objDesglose As DataTable = Nothing
        Dim objDesgloseDALC As DesgloseDALC = Nothing

        objDesgloseDALC = New DesgloseDALC
        objDesglose = New DataTable
        objDesglose = objDesgloseDALC.ListaDesgloseDetalle(objDesgloseBE, dt, sMensaje, bExito)

        Return objDesglose
    End Function


    Public Function InsertarDesglose(ByVal objDesgloseBE As DesgloseBE, ByRef bExito As Boolean, ByRef sMensaje As String) As Integer

        Dim objScope As TransactionScope
        objScope = New TransactionScope


        Using objScope
            Try
                Dim objBLImpoDesgloseDALC As DesgloseDALC = Nothing
                objBLImpoDesgloseDALC = New DesgloseDALC

                objBLImpoDesgloseDALC.InsertarDesglose(objDesgloseBE, bExito, sMensaje)

                objScope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return bExito

    End Function

End Class
